package com.mall.ibatis.persistence.sqlmapdao;

import java.util.List;

import com.mall.ibatis.bean.SysPara;
import com.mall.ibatis.persistence.iface.SysParaDAO;

import com.ibatis.dao.client.DaoManager;

public class SysParaSqlMapDAO extends BaseSqlMapDao implements SysParaDAO
{
	public SysParaSqlMapDAO(DaoManager daoManager)
	{
		super(daoManager);
	}
	
	@SuppressWarnings("unchecked")
	public List<SysPara> selectAllSysPara() throws Exception
	{
		return (List<SysPara>)queryForList("select_syspara_list",null);
	}
	
	public SysPara selectSysPara(SysPara sysPara)  throws Exception
	{
		return (SysPara)queryForObject("select_syspara", sysPara);
	}
	
	public void insertSysPara(SysPara sysPara) throws Exception
	{
		insert("insert_syspara",  sysPara);
	}
	public void updateSysPara(SysPara sysPara) throws Exception
	{
		update("update_syspara",  sysPara);
	}
	
	public void deleteSysPara(SysPara sysPara) throws Exception
	{
		update("delete_syspara",  sysPara);
	}
	
	public String selectCurrentDate() throws Exception
	{
		return queryForObject("select_current_date",null).toString();
	}
	
	public String selectCurrentMonthBegin() throws Exception
	{
		return queryForObject("select_current_month_begin",null).toString();
		
	}
}
